package com.xyf.sys.mapper;

import com.xyf.sys.domain.Dept;
import com.xyf.sys.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Mapper
@Repository
public interface DeptMapper {
    int deleteByPrimaryKey(Long deptId);

    int insert(Dept record);

    int insertSelective(Dept record);

    Dept selectByPrimaryKey(Long deptId);

    int updateByPrimaryKeySelective(Dept record);

    int updateByPrimaryKey(Dept record);

    List<Dept> selectList(@Param("keyword") String keyword);

    Dept selectByDeptName(@Param("deptName") String deptName, @Param("delFlag") String delFlag);

    List<Dept> selectByParentId(@Param("parentId") Long parentId, @Param("delFlag") String delFlag);

    List<Dept> selectNotEmptyUserDeptList(@Param("roleKey") String roleKey, @Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude, @Param("keyword") String keyword);

    Dept selectByLeader(@Param("leader") String leader);

    List<Dept> selectByRole(@Param("role") String role);

    Dept selectByMobile(@Param("mobile") String mobile);
}